Skip to content

Validate shared subnets have the same access_mode#1387

Merged
TaoZou1 merged 1 commit intovmware-tanzu:mainfrom
TaoZou1:validsharedsubnet
Mar 18, 2026
Merged

Validate shared subnets have the same access_mode#1387
TaoZou1 merged 1 commit intovmware-tanzu:mainfrom
TaoZou1:validsharedsubnet

Conversation

@TaoZou1
Copy link
Copy Markdown
Contributor

@TaoZou1 TaoZou1 commented Mar 10, 2026

All the shared subnets added to the subnetset should have the same access_mode

Test Done:

  1. create subnet3 with accessMode Public
  2. create subent3 with accessMode PrivateTGW
    k get subnet -ndev
    NAME ACCESSMODE IPV4SUBNETSIZE NETWORKADDRESSES
    subnet3 Public 32 192.168.0.96/27
    subnet4 PrivateTGW 32 10.246.0.96/27
  3. create subnetset1 with subnet3/subnet4
    k apply -f subnetset.yaml -ndev
    Error from server (Forbidden): error when creating "subnetset.yaml": admission webhook "subnetset.validating.crd.nsx.vmware.com" denied the request: Subnets in SubnetSet dev/subnetset1 must have the same AccessMode, found different AccessModes: [Public, PrivateTGW]

@TaoZou1 TaoZou1 force-pushed the validsharedsubnet branch from e76c3b3 to dc541fd Compare March 10, 2026 02:18
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.76%. Comparing base (4ba0355) to head (abbe122).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1387      +/-   ##
==========================================
+ Coverage   76.74%   76.76%   +0.01%     
==========================================
  Files         151      151              
  Lines       21307    21312       +5     
==========================================
+ Hits        16353    16361       +8     
+ Misses       3784     3783       -1     
+ Partials     1170     1168       -2     
Flag Coverage Δ
unit-tests 76.76% <100.00%> (+0.01%) ⬆️
Files with missing lines Coverage Δ
pkg/controllers/subnetset/subnetset_webhook.go 78.36% <100.00%> (+1.02%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@TaoZou1 TaoZou1 requested review from lxiaopei and yanjunz97 March 10, 2026 02:39
yanjunz97
yanjunz97 previously approved these changes Mar 11, 2026
Copy link
Copy Markdown
Contributor

@yanjunz97 yanjunz97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@TaoZou1 TaoZou1 force-pushed the validsharedsubnet branch from 51bd46e to 9477865 Compare March 13, 2026 02:34
All the shared subnets added to the subnetset should have the same access_mode
@TaoZou1 TaoZou1 force-pushed the validsharedsubnet branch from 9477865 to abbe122 Compare March 13, 2026 02:47
@TaoZou1
Copy link
Copy Markdown
Contributor Author

TaoZou1 commented Mar 13, 2026

/e2e

@TaoZou1
Copy link
Copy Markdown
Contributor Author

TaoZou1 commented Mar 16, 2026

/e2e

@TaoZou1 TaoZou1 merged commit 1e42bf1 into vmware-tanzu:main Mar 18, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants